package py.progweb.sgc.gui.server.service;

import javax.naming.NamingException;

import py.progweb.sgc.gui.client.service.CompraService;
import py.progweb.sgc.gui.client.service.RemoteServiceException;
import py.progweb.sgc.manager.ComprasFacadeLocal;
import py.progweb.sgc.model.Compra;

public class CompraServiceImpl extends BaseServiceImpl implements CompraService {

	private static final long serialVersionUID = 1L;
	ComprasFacadeLocal mgr;
	
	public CompraServiceImpl() throws NamingException {
		this.mgr = (ComprasFacadeLocal)getBean("ComprasFacade");
	}
	
	public void guardar(Compra entity) throws RemoteServiceException {
		try {
			//	logger.info("Guardando entidad: " + entity.getClass().getName() + " con pk: " + entity.getPK().toString());
			this.mgr.guardarCompra(entity);
		}catch(Exception e) {
			throw manejarError(e);
		}
	}
}
